package com.totem.base.enums;

import lombok.Getter;

import java.util.Objects;

@Getter
public enum RestrictTypeEnum {
    UNRESTRICT("UNRESTRICT"),
    SINGLE("SINGLE"),
    LONG_TERM("LONG_TERM");
    private final String code;

    RestrictTypeEnum(String code){
        this.code = code;
    }

    public static RestrictTypeEnum byCode(String code) {
        for (RestrictTypeEnum e: RestrictTypeEnum.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                return e;
            }
        }
        return null;
    }
}
